using System.Collections.Generic;
using System.Linq;

namespace Lync.Widget.Library.InstantMessaging
{	
	public class GroupMessageQueue
	{
		public string Session { get; set; }        
        private readonly List<GroupMessage> m_Messages = new List<GroupMessage>();

        public GroupMessageQueue(string session)
        {
            Session = session;            
        }
	    public List<GroupMessage> GetAllAndDelete()
		{
            List<GroupMessage> toReturn = m_Messages.ToList(); 
			m_Messages.Clear();
			return toReturn;

		}

        public void Add(GroupMessage message)
		{
			m_Messages.Add(message);
		}

		public int GetMessageCount()
		{
			return m_Messages.Count;
		}
	}
}